package round77;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/**
 * User: Samuel
 * Date: 07-08-11
 * Time: 10:41 AM
 */
public class C {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(in.readLine());
        String subs[] = new String[N];
        for (int i = 0; i < N; i++) {
            subs[i] = in.readLine().toLowerCase();
        }
        String w = in.readLine();
        String wCpy = w.toLowerCase();
        char letter = Character.toLowerCase(in.readLine().charAt(0));
        int change[] = new int[w.length()];

        for (String sub : subs) {
            int index = 0;
            while (true) {
                index = wCpy.indexOf(sub, index);
                if (index < 0) {
                    break;
                }
                Arrays.fill(change, index, index + sub.length(), 1);
                //index += sub.length();
                index++;
                if (index >= wCpy.length()) {
                    break;
                }
            }
        }

        StringBuilder sb = new StringBuilder(w);
        for (int i = 0, len = w.length(); i < len; i++) {
            if (change[i] > 0) {
                boolean isLower = Character.isLowerCase(sb.charAt(i));
                if (wCpy.charAt(i) != letter) {
                    sb.setCharAt(i, isLower ? letter : Character.toUpperCase(letter));
                } else {
                    if (letter != 'a')
                        sb.setCharAt(i, isLower ? 'a' : 'A');
                    else
                        sb.setCharAt(i, isLower ? 'b' : 'B');
                }
            }
        }
        System.out.println(sb.toString());
    }
}
